-- GENERATED SPELL FOR [Kyren] --


function spell0_24409(pUnit, Event) --@Blue Firework,Self--
pUnit:FullCastSpellOnTarget(11540,pUnit)
pUnit:RegisterEvent('Sorts_24409', 612, 1)
end

function spell1_24409(pUnit, Event) --@Green Firework,Self--
pUnit:FullCastSpellOnTarget(11541,pUnit)
pUnit:RegisterEvent('Sorts_24409', 664, 1)
end

function spell2_24409(pUnit, Event) --@Red Firework,Self--
pUnit:FullCastSpellOnTarget(6668,pUnit)
pUnit:RegisterEvent('Sorts_24409', 531, 1)
end

function spell3_24409(pUnit, Event) --@Red Streaks Firework,Self--
pUnit:FullCastSpellOnTarget(11542,pUnit)
pUnit:RegisterEvent('Sorts_24409', 582, 1)
end

function spell4_24409(pUnit, Event) --@Red, White and Blue Firework,Self--
pUnit:FullCastSpellOnTarget(11543,pUnit)
pUnit:RegisterEvent('Sorts_24409', 553, 1)
end

function spell5_24409(pUnit, Event) --@Yellow Rose Firework,Self--
pUnit:FullCastSpellOnTarget(11544,pUnit)
pUnit:RegisterEvent('Sorts_24409', 698, 1)
end

function Sorts_24409(pUnit, Event)
local choix_sorts_24409 = math.random(0, 5)
if choix_sorts_24409 == 0 then
pUnit:RegisterEvent('spell0_24409', 1, 1)
end
if choix_sorts_24409 == 1 then
pUnit:RegisterEvent('spell1_24409', 1, 1)
end
if choix_sorts_24409 == 2 then
pUnit:RegisterEvent('spell2_24409', 1, 1)
end
if choix_sorts_24409 == 3 then
pUnit:RegisterEvent('spell3_24409', 1, 1)
end
if choix_sorts_24409 == 4 then
pUnit:RegisterEvent('spell4_24409', 1, 1)
end
if choix_sorts_24409 == 5 then
pUnit:RegisterEvent('spell5_24409', 1, 1)
end
end

function mob24409_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_24409', math.random(1500, 3000), 1)
end

function mob24409_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24409_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24409_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(24409, 1, 'mob24409_Action')
RegisterUnitEvent(24409, 2, 'mob24409_Leave')
RegisterUnitEvent(24409, 3, 'mob24409_Kill')
RegisterUnitEvent(24409, 4, 'mob24409_Die')
